define dpe
  if ($argc < 2)
    printf "Usage: dpe pe_type pe_config [enable]\n"
  end
  if ($argc >= 2)
    set $tmp=0
    while $tmp<$cpu_number
      eval "tvariable $pc_pe_type_%d%d_%d=%d",$arg0, $arg1, $tmp, $arg0
      eval "tvariable $pc_pe_config_%d%d_%d=%d",$arg0, $arg1, $tmp, $arg1
      eval "tvariable $pc_pe_val_%d%d_%d=0",$arg0, $arg1, $tmp
      if ($argc >= 3)
        eval "tvariable $pc_pe_en_%d%d_%d=%d",$arg0, $arg1, $tmp, $arg2
      end
      set $tmp=$tmp+1
    end
  end
end

dpe 0 0
dpe 0 1
dpe 0 2
dpe 0 3
dpe 0 4
dpe 0 5
dpe 0 6

set $tmp=0
while $tmp<$cpu_number
  eval "tvariable $pc_cc_%d",$tmp
  eval "tvariable $pc_cr_%d",$tmp
  set $tmp=$tmp+1
end

trace tcp_v4_rcv if ($cpu_id == 0)
  commands
    teval $pc_pe_en=1
    teval $pc_cc_0=$clock
    teval $pc_cr_0=$rdtsc
  end

list tcp_v4_rcv
trace 1861 if ($cpu_id == 0)
  commands
    teval $pc_pe_en=0
    teval $pc_cc_0=$clock-$pc_cc_0
    teval $pc_cr_0=$rdtsc-$pc_cr_0
    collect $pc_cc_0
    collect $pc_cr_0
    collect $pc_pe_val_00_0
    teval $pc_pe_val_00_0=0
    collect $pc_pe_val_01_0
    teval $pc_pe_val_01_0=0
    collect $pc_pe_val_02_0
    teval $pc_pe_val_02_0=0
    collect $pc_pe_val_03_0
    teval $pc_pe_val_03_0=0
    collect $pc_pe_val_04_0
    teval $pc_pe_val_04_0=0
    collect $pc_pe_val_05_0
    teval $pc_pe_val_05_0=0
    collect $pc_pe_val_06_0
    teval $pc_pe_val_06_0=0
    collect cc
    collect cr
    collect p00
    collect p01
    collect p02
    collect p03
    collect p04
    collect p05
    collect p06
  end
